#include <iostream>
#include <time.h>

#include "src/log/log.h"
#include "src/utils/utils.h"
#include "src/widgets/Config.h"
#include "src/widgets/AddNoteBookDialog.h"

hps::Logger::ptr g_logger = LOG_ROOT();

void testLog() {
    LOG_DEBUG(g_logger) << "Hello, World!";
}

void testTimeFormat() {
    auto time = hps::GetCurrentMS();
    time_t _time = time;
    std::cout << _time << std::endl;
    std::cout << hps::TimeFormat(time) << std::endl;
}

class A {
public:
    typedef std::shared_ptr<A> ptr;
public:
    A() {
        std::cout << "Creat A;" << std::endl;
    }
    ~A() {
        std::cout << "~ A;" << std::endl;
    }
};

void testAddNoteBookCfg() {
    std::string bookName = "testBook", bookPath = "testPath";
    CONFIG()->addNoteBook(bookName, bookPath);
    CONFIG()->outPutJsonCfg();
    std::cout << CONFIG()->getNoteBookCfg().NoteBookMap[bookName] << std::endl;
}



int main(int avg, char **avgs) {
//    testLog();
//    testTimeFormat();
//    std::cout << "test end" << std::endl;
//    LOG_DEBUG(g_logger) << "now I'm in main funcation.";
//    testAddNoteBookCfg();
    return 0;
}